home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Interfaces / MPW Interfaces / CIncludes / Palettes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  4.2 KB  |  146 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Palettes.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __PALETTES__
  13. #define __PALETTES__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18.  
  19. #ifndef __WINDOWS__
  20. #include <Windows.h>
  21. #endif
  22.  
  23.  
  24. enum {
  25.  
  26.  pmCourteous = 0,            /*Record use of color on each device touched.*/
  27.  pmTolerant = 0x0002,        /*render ciRGB if ciTolerance is exceeded by best match.*/
  28.  pmAnimated = 0x0004,        /*reserve an index on each device touched and render ciRGB.*/
  29.  pmExplicit = 0x0008,        /*no reserve, no render, no record; stuff index into port.*/
  30.  
  31.  pmWhite = 0x0010,
  32.  pmBlack = 0x0020,
  33.  
  34.  pmInhibitG2 = 0x0100,
  35.  pmInhibitC2 = 0x0200,
  36.  pmInhibitG4 = 0x0400,
  37.  pmInhibitC4 = 0x0800,
  38.  pmInhibitG8 = 0x1000,
  39.  pmInhibitC8 = 0x2000,
  40.  
  41.  
  42. /* NSetPalette Update Constants */
  43.  pmNoUpdates = 0x8000,        /*no updates*/
  44.  pmBkUpdates = 0xA000,        /*background updates only*/
  45.  pmFgUpdates = 0xC000,        /*foreground updates only*/
  46.  pmAllUpdates = 0xE000        /*all updates*/
  47. };
  48.  
  49. struct ColorInfo {
  50.  RGBColor ciRGB;            /*true RGB values*/
  51.  short ciUsage;                /*color usage*/
  52.  short ciTolerance;            /*tolerance value*/
  53.  short ciDataFields[3];        /*private fields*/
  54. };
  55.  
  56. typedef struct ColorInfo ColorInfo;
  57.  
  58. struct Palette {
  59.  short pmEntries;            /*entries in pmTable*/
  60.  short pmDataFields[7];        /*private fields*/
  61.  ColorInfo pmInfo[1];
  62. };
  63.  
  64. typedef struct Palette Palette;
  65. typedef Palette *PalettePtr, **PaletteHandle;
  66.  
  67.  
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. pascal void InitPalettes(void)
  72.  = 0xAA90; 
  73. pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
  74.  short srcTolerance)
  75.  = 0xAA91; 
  76. pascal PaletteHandle GetNewPalette(short PaletteID)
  77.  = 0xAA92; 
  78. pascal void DisposePalette(PaletteHandle srcPalette)
  79.  = 0xAA93; 
  80. pascal void ActivatePalette(WindowPtr srcWindow)
  81.  = 0xAA94; 
  82. pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
  83.  = 0xAA95; 
  84. pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
  85.  = 0xAA95; 
  86. pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  87.  = 0xAA96; 
  88. pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
  89.  short srcEntry,short dstEntry,short dstLength)
  90.  = 0xAAA1; 
  91. pascal void PmForeColor(short dstEntry)
  92.  = 0xAA97; 
  93. pascal void PmBackColor(short dstEntry)
  94.  = 0xAA98; 
  95. pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor *srcRGB)
  96.  = 0xAA99; 
  97. pascal void AnimatePalette(WindowPtr dstWindow,CTabHandle srcCTab,short srcIndex,
  98.  short dstEntry,short dstLength)
  99.  = 0xAA9A; 
  100. pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor *dstRGB)
  101.  = 0xAA9B; 
  102. pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor *srcRGB)
  103.  = 0xAA9C; 
  104. pascal void GetEntryUsage(PaletteHandle srcPalette,short srcEntry,short *dstUsage,
  105.  short *dstTolerance)
  106.  = 0xAA9D; 
  107. pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
  108.  short srcTolerance)
  109.  = 0xAA9E; 
  110. pascal void CTab2Palette(CTabHandle srcCTab,PaletteHandle dstPalette,short srcUsage,
  111.  short srcTolerance)
  112.  = 0xAA9F; 
  113. pascal void Palette2CTab(PaletteHandle srcPalette,CTabHandle dstCTab)
  114.  = 0xAAA0; 
  115. pascal long Entry2Index(short entry)
  116.  = {0x7000,0xAAA2}; 
  117. pascal void RestoreDeviceClut(GDHandle gd)
  118.  = {0x7002,0xAAA2}; 
  119. pascal void ResizePalette(PaletteHandle p,short size)
  120.  = {0x7003,0xAAA2}; 
  121. pascal void SaveFore(ColorSpec *c)
  122.  = {0x303C,0x040D,0xAAA2}; 
  123. pascal void SaveBack(ColorSpec *c)
  124.  = {0x303C,0x040E,0xAAA2}; 
  125. pascal void RestoreFore(const ColorSpec *c)
  126.  = {0x303C,0x040F,0xAAA2}; 
  127. pascal void RestoreBack(const ColorSpec *c)
  128.  = {0x303C,0x0410,0xAAA2}; 
  129. pascal OSErr SetDepth(GDHandle gd,short depth,short whichFlags,short flags)
  130.  = {0x303C,0x0A13,0xAAA2}; 
  131. pascal short HasDepth(GDHandle gd,short depth,short whichFlags,short flags)
  132.  = {0x303C,0x0A14,0xAAA2}; 
  133. pascal short PMgrVersion(void)
  134.  = {0x7015,0xAAA2}; 
  135. pascal void SetPaletteUpdates(PaletteHandle p,short updates)
  136.  = {0x303C,0x0616,0xAAA2}; 
  137. pascal short GetPaletteUpdates(PaletteHandle p)
  138.  = {0x303C,0x0417,0xAAA2}; 
  139. pascal Boolean GetGray(GDHandle device,const RGBColor *backGround,RGBColor *foreGround)
  140.  = {0x303C,0x0C19,0xAAA2}; 
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144.  
  145. #endif
  146.